apply plugin: 'com.android.application'
android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        applicationId "org.libsdl.app"
        minSdkVersion 18
        targetSdkVersion 27

	    externalNativeBuild {
	        cmake {
                Properties properties = new Properties()
                properties.load(project.rootProject.file('local.properties').newDataInputStream())
                def sdl2SrcDir = properties.getProperty('sdl2_src.dir') ?: "add sdl2_src.dir in local.properties"
                def sdl2BuildDir = properties.getProperty('sdl2_build.dir') ?: "add sdl2_build.dir in local.properties"

                arguments "-DSDL2_SRC_DIR=" + sdl2SrcDir
                arguments "-DSDL2_BUILD_DIR=" + sdl2BuildDir
                arguments "-DANDROID_ARM_NEON=TRUE"
	            arguments "-DANDROID_CPP_FEATURES=rtti exceptions",
	                      "-DANDROID_STL=c++_shared"
	        }
	    }

        ndk {
            abiFilters 'x86', /*'x86_64',*/ 'armeabi-v7a', 'arm64-v8a'
        }

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    externalNativeBuild {
        cmake {
            path '../../CMakeLists.txt'
        }
    }
}

dependencies {
}